// import query from '@feidao/web/atom/nodejs/db/query';
import query from '@dfeidao/atom-nodejs/db/query';
// import { systemid } from './config';

interface Message {
	role_type_id: string;
	productid: string;
}


export default async function atom(msg: Message, action_id: string, session_id: string) {
	const systemid = '12';
	const { exec, prepare } = query(action_id, session_id, systemid);

	prepare('pub_role', ['role_no', 'role_name', 'role_type_id', 'create_time', 'icon', 'productid'], {
		role_type_id: msg.role_type_id, productid: msg.productid
	}, 100, 1, [], []);
	const [data] = await exec();

	return data;
}
